package chabernac.android.wordbattle.paint;

import java.util.HashSet;
import java.util.Random;
import java.util.Set;

import android.graphics.Color;

public class ColorFactory {
  private static Set<Integer> USED_COLORS = new HashSet<Integer>();
  private static Random RANDOM = new Random();

  private static int randomColor(){
    return 50 + Math.abs(RANDOM.nextInt() % 5) * 40;
  }

  public static int getRandomColor( ) {
    int theRandomColor = Color.argb(150, randomColor(), randomColor(), randomColor()); 
    while(USED_COLORS.contains(theRandomColor)){
      theRandomColor = Color.argb(150, randomColor(), randomColor(), randomColor());
    }
    USED_COLORS.add(theRandomColor);
    return theRandomColor;
  }

}
